package com.starlink.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.starlink.model.domain.SearchRecordDO;
import com.starlink.model.request.SearchRecordRequest;
import com.starlink.model.request.mall.MallSearchRequest;
import com.starlink.model.vo.SearchRecordVO;
import com.starlink.model.vo.mall.MallSearchVO;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * @author zhanghong
 */
public interface SearchRecordService extends IService<SearchRecordDO> {

    /**
     * 根据主键查询
     * @param id
     * @return
     */
    SearchRecordVO getByKey(long id);
    /**
     * 列表查询
     * @param request
     * @return
     */
    List<SearchRecordVO> listQuery(SearchRecordRequest request);
    /**
     * 新增
     * @param request
     * @return
     */
    Boolean add(SearchRecordRequest request);
    /**
     * 根据主键更新
     * @param request
     * @return
     */
    Boolean updateByKey(SearchRecordRequest request);
    /**
     * 根据主键删除
     * @param ids
     * @return
     */
    Boolean deleteByIds(String ids);

    /**
     * 商城搜索
     * @param request
     * @return
     */
    PageInfo<List<MallSearchVO>> search(MallSearchRequest request, Pageable pageable);

    /**
     * 搜索记录保存
     * @param request
     * @return
     */
    Boolean searchSave(SearchRecordRequest request);

    /**
     * 搜索记录清除
     * @param userId
     * @return
     */
    Boolean searchDeleted(Long userId);

    /**
     * 搜索记录查询
     * @return
     */
    List<SearchRecordVO> searchSelect();

}
